import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Dashboard from '../views/Dashboard.vue'
import SkillsAnalysis from '../views/SkillsAnalysis.vue'
import SalaryAnalysis from '../views/SalaryAnalysis.vue'
import EducationAnalysis from '../views/EducationAnalysis.vue'
import CityCompare from '../views/CityCompare.vue'
import ProfileMatch from '../views/ProfileMatch.vue'
import JobRecommend from '../views/JobRecommend.vue'
import CareerAdvice from '../views/CareerAdvice.vue'
import LearningResources from '../views/LearningResources.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: '',
          name: 'dashboard',
          component: Dashboard
        },
        {
          path: 'skills',
          name: 'skills',
          component: SkillsAnalysis
        },
        {
          path: 'salary',
          name: 'salary',
          component: SalaryAnalysis
        },
        {
          path: 'education',
          name: 'education',
          component: EducationAnalysis
        },
        {
          path: 'city-compare',
          name: 'city-compare',
          component: CityCompare
        },
        {
          path: 'profile-match',
          name: 'profile-match',
          component: ProfileMatch,
          children: [
            {
              path: '',
              name: 'job-recommend',
              component: JobRecommend
            },
            {
              path: 'career-advice',
              name: 'career-advice',
              component: CareerAdvice
            },
            {
              path: 'learning-resources',
              name: 'learning-resources',
              component: LearningResources
            }
          ]
        }
      ]
    }
  ]
})

export default router